<?php
    $this->load->view("fungsiPenting.php");
    
    foreach($getDetail as $row){
        $vnik 		= 	$row['USRUPD'];
	    $vname 		= 	$row['NAME'];
    	$vorg 		= 	$row['ORG'];
    	$vjob		= 	$row['JOB_POSITION'];
    	$vmsisdn	= 	$row['MSISDN'];
    	$viscard	=	$row['ISCARD'];
    	$vistelp	=	$row['ISTELP'];
    	$vusefor	=	$row['USE_FOR'];
    	$vvendor	=	$row['VENDOR'];
    	$vusername	=	$row['USER_NAME'];
    	$vdtmupd	=	$row['DTMUPD'];
    	$vdesc		=	$row['CTRL_DESCRIPTION'];
    	$vdate1		=	$row['CTRL_DATE_AWAL'];
    	$vdate2		=	$row['CTRL_DATE_AKHIR'];
    	$vtime1		=	$row['CTRL_HOUR_AWAL'];
    	$vtime2		=	$row['CTRL_HOUR_AKHIR'];
    	$vAtasanNik =   $row['CTRL_ATASAN_ID'];
    	$vPhoneFisik=	$row['CTRL_TELP_FISIK'];
    	$vCardFisik	=	$row['CTRL_CARD_FISIK'];
    	$vCommentGA	=	$row['CTRL_COMMENT_GA'];
    	$vAtasanName=   $row['ATASANNAME'];
    }
?>
<!--
<div class="container" style="margin-top:40px">
-->
	<div class="col-md-offset-0" id="top">
	<div class="col-md-11">
	<div id="report" class="panel panel-default">
		<div class="panel-heading">
		<h4 class="panel-title"><b> Access Control</b></h4>
		
		<div class="btn-group pull-right">
			<button class="btn btn-default btn-sm" id="btnExport"><i class="icon-file-excel on-left"></i> Excel</button>
			<button class="btn btn-default btn-sm" type='button' value='Print' onclick="printDiv('tblExport');"><i class="icon-printer on-left"></i> Print</button>
		</div>
		
		</div>
		<div class="panel-body" id="tblExport">	
			<div class="row">
				<div class="col-sm-4">
					<img class="img-responsive" src="<?php echo base_url() ?>static/images/logo_telkomsel.png">
				</div>
				<div class="col-sm-4" align="center">
                    <h3>
                    <?php echo $cRequestNo;?>
                    </h3>
				</div>
				<div class="col-sm-4"></div>
			</div>
			<br />
			
			<div class="row">
				<div class="col-sm-12">
					<div class="table-responsive" style="border: none;">
						<table class="table" style="border: none;">
                        <!--<table>-->
							
							<tr>
								<td width="30%">Nik</td>                    <td width="5%">:</td>         <td width="65%"><?php echo $vnik;?></td>
                            </tr>
                            <tr>
								<td width="30%">Nama</td>                   <td width="5%">:</td>         <td width="65%"><?php echo $vname;?></td>
                            </tr>
                            <tr>    
								<td width="30%">Departemen</td>             <td width="5%">:</td>         <td width="65%"><?php echo $vorg;?></td>
                            </tr>
                            <tr>    
                                <td width="30%">Position</td>               <td width="5%">:</td>         <td width="65%"><?php echo $vjob;?></td>
                            </tr>
                            <tr>
                                <td width="30%">No. Hp</td>                 <td width="5%">:</td>         <td width="65%"><?php echo $vmsisdn;?></td>
                            </tr>
                            <tr>
                                <td width="30%">Access Control</td>         <td width="5%">:</td>         <td width="65%"><?php foreach($getFloor as $row){ $pKey 	= $row['CARD_FLOOR_NAME']; echo "$pKey &nbsp;&nbsp";}?></td>
                            </tr>
                            <tr>
                                <td width="30%">Line Telp</td>              <td width="5%">:</td>         <td width="65%"><?php if($vistelp == 1) {echo "Yes"; }else { echo "No"; } ?></td>
                            </tr>
                            <tr>
                                <td width="30%">Fasilitas Line Telp</td>    <td width="5%">:</td>         <td width="65%"><?php foreach($getTelp as $row){ $pKey 	= $row['TELP_EXT_EXT_TYPE']; echo "$pKey &nbsp;&nbsp";}?></td>
                            </tr>
                            <tr>
                                <td width="30%">ID Card</td>                <td width="5%">:</td>         <td width="65%"><?php if($vCardFisik== '1') {$vCardFisik="Yes";}else{$vCardFisik="No";}echo $vCardFisik;?></td>
                            </tr>
                            <tr>
                                <td width="30%">Fixed Phone</td>            <td width="5%">:</td>         <td width="65%"><?php echo $vPhoneFisik;?></td>
                            </tr>
                            <tr>
                                <td width="30%">Use For</td>                <td width="5%">:</td>         <td width="65%"><?php echo $vusefor;?></td>
                            </tr>
                            <tr>
                                <td width="30%">Vendor Name</td>            <td width="5%">:</td>         <td width="65%"><?php echo $vvendor;?></td>
                            </tr>
                            <tr>
                                <td width="30%">Person</td>                 <td width="5%">:</td>         <td width="65%"><?php echo $vusername;?></td>
                            </tr>
                            <tr>
                                <td width="30%">Periode</td>                <td width="5%">:</td>         <td width="65%"><?php echo $vdate1." s/d ".$vdate2;?></td>
                            </tr>
                            <tr>
                                <td width="30%">Tgl Request Order</td>      <td width="5%">:</td>         <td width="65%"><?php echo $vdtmupd;?></td>
                            </tr>
                            <tr>
                                <td width="30%">Description</td>            <td width="5%">:</td>         <td width="65%"><?php echo nl2br($vdesc);?></td>
                            </tr>
                            <tr>
                                <td width="30%">Nama Atasan</td>            <td width="5%">:</td>         <td width="65%"><?php echo $vAtasanName;?></td>
                            </tr>
                            <tr>
                                <td width="30%">Comment</td>                <td width="5%">:</td>         <td width="65%"><?php echo nl2br($vCommentGA);?></td>
							</tr>    
						</table>
					</div>
					
				</div>
			</div>
			
		</div>
	</div>
	</div>
	</div>
<!--</div>-->

<script>
	$(function() {
		$("input[id^='datepicker']").datetimepicker({
			scrollInput: false,
			yearOffset:0,
			lang:'en',
			timepicker:false,
			datepicker:true,
			format:'d-m-Y',
			formatDate:'d/m/Y',
			/*minDate:'-1970/01/01',
			onGenerate:function( ct ){
				$(this).find('.xdsoft_date.xdsoft_weekend')
					.addClass('xdsoft_disabled');
			}*/
		});
	});
</script>
<script>
    $(document).ready(function () {
        $("#btnExport").click(function () {
            $("#tblExport").btechco_excelexport({
                containerid: "tblExport"
               , datatype: $datatype.Table
               , filename: 'Report_Coordination_<?php echo str_replace("-","",$this->input->post('date_start'))."-".str_replace("-","",$this->input->post('date_end')); ?>'
            });
			
        });
		
    });
</script>
<script>
	function printDiv(divName) 
	{
		var printContents = document.getElementById(divName).innerHTML;     
		var originalContents = document.body.innerHTML;       
		document.body.innerHTML = printContents;      
		window.print();      
		document.body.innerHTML = originalContents;
		window.parent.reload();
   }
</script>
<style type="text/css">
table { border-collapse:collapse; width:100%;}
table td, table th { border:1px solid #ddd; padding:2px; }

table { page-break-inside:auto }
tr    { page-break-inside:avoid; page-break-after:auto }
thead { display:table-header-group }
tfoot { display:table-footer-group }

.table > tbody > tr > td {
	padding: 3px;
}
</style>

